package com.zzh.partnersys.im.controller;


import com.zzh.partnersys.common.exception.ResultUtils;
import com.zzh.partnersys.im.entity.ChatSession;
import com.zzh.partnersys.im.entity.request.ChatSessionCreateRequest;
import com.zzh.partnersys.im.service.ChatSessionService;
import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 单聊会话表 前端控制器
 * </p>
 *
 * @author zzh
 * @since 2025-11-19
 */
@RestController
@RequestMapping("/chatSession")
public class ChatSessionController {


    @Resource
    private ChatSessionService chatSessionService;


    /**
     * 创建User-AI会话
     */
    @PostMapping("/create")
    public ResultUtils<ChatSession> createUserAIChatSession(@RequestBody ChatSessionCreateRequest createRequest, HttpServletRequest request) {
        ChatSession chatSession = chatSessionService.createChatSession(createRequest,request);
        return ResultUtils.ok(chatSession);
    }

}

